home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / Telephone Manager / Interfaces / Telephones.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-18  |  46.6 KB  |  957 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Telephones.h
  3.  
  4.      Contains:    Interface to the Telephone Manager
  5.  
  6.        Version:    Technology:    System 7.5
  7.                  Package:    Telephone Manager on Mac OS SDK #4
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17. */
  18.  
  19. #ifndef __TELEPHONES__
  20. #define __TELEPHONES__
  21.  
  22.  
  23. #ifndef __TYPES__
  24. #include <Types.h>
  25. #endif
  26. /*    #include <ConditionalMacros.h>                                */
  27.  
  28. #ifndef __WINDOWS__
  29. #include <Windows.h>
  30. #endif
  31. /*    #include <Memory.h>                                            */
  32. /*        #include <MixedMode.h>                                    */
  33. /*    #include <Quickdraw.h>                                        */
  34. /*        #include <QuickdrawText.h>                                */
  35. /*    #include <Events.h>                                            */
  36. /*        #include <OSUtils.h>                                    */
  37. /*    #include <Controls.h>                                        */
  38. /*        #include <Collections.h>                                */
  39. /*        #include <Appearance.h>                                    */
  40. /*            #include <Files.h>                                    */
  41. /*        #include <Menus.h>                                        */
  42. /*            #include <TextObjects.h>                            */
  43. /*                #include <Unicode.h>                            */
  44. /*    #include <AppleEvents.h>                                    */
  45. /*        #include <Errors.h>                                        */
  46. /*        #include <EPPC.h>                                        */
  47. /*            #include <AppleTalk.h>                                */
  48. /*            #include <PPCToolbox.h>                                */
  49. /*            #include <Processes.h>                                */
  50. /*        #include <Notification.h>                                */
  51. /*            #include <Kernel.h>                                    */
  52. /*                #include <MachineExceptions.h>                    */
  53. /*                #include <Timing.h>                                */
  54. /*    #include <Drag.h>                                            */
  55. /*        #include <TextEdit.h>                                    */
  56.  
  57. #ifndef __DIALOGS__
  58. #include <Dialogs.h>
  59. #endif
  60.  
  61. #ifndef __CTBUTILITIES__
  62. #include <CTBUtilities.h>
  63. #endif
  64. /*    #include <StandardFile.h>                                    */
  65.  
  66. #ifndef __COMPONENTS__
  67. #include <Components.h>
  68. #endif
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73.  
  74. #if GENERATINGPOWERPC
  75. #pragma options align=mac68k
  76. #endif
  77.  
  78. #ifdef __CFM68K__
  79. #pragma import on
  80. #endif
  81.  
  82. #ifndef classTEL
  83.  
  84. enum {
  85. /* telephone tool file type */
  86.     classTEL                    = 'vbnd'
  87. };
  88.  
  89. #endif
  90.  
  91. enum {
  92.     curTELVersion                = 3,                            /* current Telephone Manager version */
  93. /*    the chooseXXX symbols are defined in CTBUtilities.(pah) */
  94.     telChooseDisaster            = chooseDisaster,
  95.     telChooseFailed                = chooseFailed,
  96.     telChooseAborted            = chooseAborted,
  97.     telChooseOKMinor            = chooseOKMinor,
  98.     telChooseOKMajor            = chooseOKMajor,
  99.     telChooseCancel                = chooseCancel,
  100.     telChooseOKTermChanged        = 4
  101. };
  102.  
  103. enum {
  104. /* PHYSICAL TERMINAL CONSTANTS 
  105.  
  106. * INDEPENDENT HANDSET CONSTANTS */
  107.     telIndHSOnHook                = 0,                            /* independent handset on hook */
  108.     telIndHSOffHook                = 1,                            /* independent handset off hook */
  109.     telIndHSDisconnected        = 0,                            /* handset disconnected from the line */
  110.     telIndHSConnected            = 1,                            /* handset connected to the line */
  111. /* HOOK STATE CONSTANTS */
  112.     telHandset                    = 1,                            /* handset hookswitch */
  113.     telSpeakerphone                = 2,                            /* speakerphone 'on' switch */
  114.     telDeviceOffHook            = 1,                            /* device off hook */
  115.     telDeviceOnHook                = 0,                            /* device on hook */
  116. /* VOLUME CONTROL CONSTANTS */
  117.     telHandsetSpeakerVol        = 1,                            /* volume of the handset speaker */
  118.     telHandsetMicVol            = 2,                            /* sensitivity of the handset mic */
  119.     telSpeakerphoneVol            = 3,                            /* speakerphone volume */
  120.     telSpeakerphoneMicVol        = 4,                            /* sensitivity of the spkrphone mic */
  121.     telRingerVol                = 5,                            /* volume of the ringer */
  122.     telBuiltinSPVol                = 6,                            /* volume of the built-in speakerphone */
  123.     telBuiltinSPMicVol            = 7,                            /* sensitivity of the built-in speakerphone mic */
  124.     telVolSame                    = 0,                            /* leaves the volume at previous level */
  125.     telVolMin                    = 1,                            /* turns volume down to minimum level, but not off */
  126.     telVolMax                    = 100,                            /* highest level allowed by the Telephone Manager */
  127.     telVolStateSame                = 0,                            /* leaves device in same state */
  128.     telVolStateOff                = 1,                            /* turns the device off , 
  129.                                  * but doesn't change the volume setting. 
  130.                                  * Use for mute functions. */
  131.     telVolStateOn                = 2,                            /* turns the device on.  Volume setting is 
  132.                                  * the same as previously set.*/
  133. /* DISPLAY CONSTANTS */
  134.     telNormalDisplayMode        = 1,                            /* normal display mode */
  135.     telInspectMode                = 2,                            /* inspect display mode */
  136.     telMiscMode                    = 3,                            /* miscellaneous display mode */
  137.     telRetrieveMode                = 4,                            /* message retrieval mode */
  138.     telDirectoryQueryMode        = 5,                            /* electronic directory mode */
  139.     telEntireDisplay            = 0,                            /* entire Display */
  140. /* KEY PRESS CONSTANTS */
  141.     telHangupKey                = 1,                            /* drop, or release, key pressed */
  142.     telHoldKey                    = 2,                            /* hold key pressed */
  143.     telConferenceKey            = 3,                            /* conference key pressed */
  144.     telTransferKey                = 4,                            /* transfer key pressed */
  145.     telForwardKey                = 5,                            /* call forward key pressed */
  146.     telCallbackKey                = 6,                            /* call back key pressed */
  147.     telDNDKey                    = 7,                            /* do not disturb key pressed */
  148.     telCallPickupKey            = 8,                            /* call Pickup key pressed */
  149.     telCallParkKey                = 9,                            /* call Park key pressed */
  150.     telCallDeflectKey            = 10,                            /* call Deflect key pressed */
  151.     telVoiceMailAccessKey        = 11,                            /* voice Mail Access key pressed */
  152.     telCallRejectKey            = 12,                            /* call Reject key pressed */
  153.     telOtherKey                    = 16,                            /* other key pressed */
  154.     telKeyPadPress                = 1,                            /* key pressed on 12 digit keypad*/
  155.     telFeatureKeyPress            = 2,                            /* feature Key Pressed */
  156.     telTerminalEnabled            = 0,
  157.     telTerminalDisabled            = 1,
  158.     telUnknown                    = 0,                            /* unknown error */
  159.     telTerminalHWDisconnected    = 1,                            /* terminal hardware is disconnected */
  160.     telDeviceDriverClosed        = 2,                            /* device driver is closed */
  161. /* ALERT PATTERN */
  162.     telPattern0                    = 0,
  163.     telPattern1                    = 1,
  164.     telPattern2                    = 2,
  165.     telPattern3                    = 3,
  166.     telPattern4                    = 4,
  167.     telPattern5                    = 5,
  168.     telPattern6                    = 6,
  169.     telPattern7                    = 7,
  170.     telPatternOff                = 8,
  171.     telPatternUndefined            = 15,
  172. /* DN TYPES */
  173.     telAllDNs                    = 0,                            /* counts all types of DNs */
  174.     telInternalDNs                = 1,                            /* connected to PBX or other non-public switch */
  175.     telInternalDNsOnly            = 2,                            /* connected to PBX or other non-public switch 
  176.                                  * and able to place internal calls only */
  177.     telExternalDNs                = 3,                            /* connected to public network */
  178.     telDNTypeUnknown            = 4,                            /* DN type unknown */
  179. /* DN USAGE */
  180.     telDNNotUsed                = 0,                            /* DN is not used - onhook */
  181.     telDNPOTSCall                = 1,                            /* DN used for POTs call */
  182.     telDNFaxCall                = 2,                            /* DN used for fax call */
  183.     telDNDataCall                = 3,                            /* DN used for data call */
  184.     telDNAlerting                = 4,                            /* Incoming call at DN */
  185.     telDNUnknownState            = 5,                            /* DN is in unknown state */
  186. /* CALL FORWARDING TYPES */
  187.     telForwardImmediate            = 1,                            /* immediately forward calls */
  188.     telForwardBusy                = 2,                            /* forward on Busy */
  189.     telForwardNoAnswer            = 3,                            /* forward on No answer */
  190.     telForwardBusyNA            = 4,                            /* forwarding for busy and no answer*/
  191.     telForwardTypeUnknown        = 5,                            /* type of forwarding is unknown */
  192. /* CALL FORWARDING MESSAGES */
  193.     telForwardCleared            = 0,                            /* forwarding has been cleared */
  194.     telForwardEst                = 1,                            /* forwarding has been established*/
  195.     telForwardFailed            = 2,                            /* attempt to setup forwarding has failed*/
  196. /* DO NOT DISTURB TYPES */
  197.     telDNDIntExt                = 0,                            /* do not disturb for all internal and external calls*/
  198.     telDNDExternal                = 1,                            /* do not disturb for external calls only */
  199.     telDNDInternal                = 2,                            /* do not disturb for internal calls only */
  200.     telDNDNonIntercom            = 3,                            /* do not disturb for all calls except intercom */
  201. /* DO NOT DISTURB MESSAGES */
  202.     telDNDCleared                = 0,                            /* do not disturb has been cleared */
  203.     telDNDEst                    = 1,                            /* do not disturb has been established */
  204.     telDNDFailed                = 2,                            /* attempt to setup do not disturb has failed */
  205. /* VOICE MAIL MESSAGES */
  206.     telAllVoiceMessagesRead        = 0,                            /* all messages have been read, none are  waiting 
  207.                                  * to be read */
  208.     telNewVoiceMessage            = 1,                            /* a new message has arrived or messages are waiting 
  209.                                  * for this DN */
  210. /* DNSELECT MESSAGE */
  211.     telDNDeselected                = 0,                            /* DN has been deselected */
  212.     telDNSelected                = 1,                            /* DN has been selected */
  213. /* CALL ORIGINATORS */
  214.     telInternalCall                = 0,                            /* return nth internal CA */
  215.     telExternalCall                = 1,                            /* return nth external CA */
  216.     telUnknownCallOrigin        = 2,                            /* unknown call type */
  217.     telAllCallOrigins            = 2,                            /* return nth CA internal or external */
  218. /* CALL TYPES */
  219.     telVoiceMailAccessOut        = (-7),
  220.     telPageOut                    = (-6),
  221.     telIntercomOut                = (-5),
  222.     telCallbackOut                = (-4),
  223.     telPickup                    = (-3),
  224.     telParkRetrieve                = (-2),
  225.     telNormalOut                = (-1),
  226.     telUnknownCallType            = 0,
  227.     telNormalIn                    = 1,
  228.     telForwardedImmediate        = 2,
  229.     telForwardedBusy            = 3,
  230.     telForwardedNoAnswer        = 4,
  231.     telTransfer                    = 5,
  232.     telDeflected                = 6,
  233.     telIntercepted                = 7,
  234.     telDeflectRecall            = 8,
  235.     telParkRecall                = 9,
  236.     telTransferredRecall        = 10,
  237.     telIntercomIn                = 11,
  238.     telCallbackIn                = 12,
  239. /* DIAL TYPES */
  240.     telDNDialable                = 0,                            /* this DN could be dialed via TELSetupCall */
  241.     telDNNorthAmerican            = 1,                            /* rmtDN is standard North America 10 digit number */
  242.     telDNInternational            = 2,                            /* rmtDN is an international number */
  243.     telDNAlmostDialable            = 3,                            /* rmtDN is almost dialable, */
  244. /* missing prefix such as 9 or 1 */
  245.     telDNUnknown                = 15,                            /* unknown whether DN is dialable */
  246. /* CALL PROGRESS MESSAGES */
  247.     telCAPDialTone                = 1,                            /* dial tone */
  248.     telCAPRinging                = 2,                            /* destination CA is alerting */
  249.     telCAPDialing                = 3,                            /* dialing the other end */
  250.     telCAPReorder                = 4,                            /* reorder */
  251.     telCAPBusy                    = 5,                            /* busy */
  252.     telCAPRouted                = 6,                            /* call routed; rmtDN will hold the routing directory */
  253. /* number routeDN and routePartyName have been updated */
  254.     telCAPRoutedOff                = 7,                            /* call routed off-network; no further progress will */
  255. /* be available */
  256.     telCAPTimeout                = 8,                            /* call timed out */
  257.     telCAPUpdate                = 9,                            /* name and rmtDN information has been updated */
  258.     telCAPPrompt                = 10,                            /* the network is prompting for more information */
  259.     telCAPWaiting                = 11,                            /* call is proceeding, but there is no response yet */
  260. /* from the destination */
  261.     telCAPCPC                    = 12,                            /* telephone tool detected CPC signal */
  262.     telCAPNoDialTone            = 13,                            /* dial tone not detected */
  263.     telCAPUnknown                = 15,                            /* call progress state unknown */
  264.     telCAPDialDisabled            = 16,                            /* Blacklisting: Dial Disabled */
  265.     telCAPBlacklistedNumber        = 17,                            /* Blacklisting: Blacklisted Number */
  266.     telCAPForbiddenNumber        = 18,                            /* Blacklisting: Forbidden Number */
  267.     telCAPModemGuardTime        = 19,                            /* Modem Guard Timein force, unable to dial */
  268.     telCAPLCDetected            = 20,                            /* trying to dial a number while the handset is offhook */
  269.     telCAPLostLC                = 21,                            /* trying manual dial or answer while handset not off hook 
  270.                                      * or also lost line current during dialing. */
  271. /* OUTGOING CALL MESSAGES */
  272.     telPhysical                    = 0,                            /* user lifted handset and initiated call */
  273.     telProgrammatic                = 1,                            /* programmatic initiation of outgoing call */
  274. /* DISCONNECT MESSAGES */
  275.     telLocalDisconnect            = 0,                            /* local party, this user, responsible for disconnect */
  276.     telRemoteDisconnect            = 1,                            /* remote party responsible for disconnect */
  277. /* DISCONNECT TYPES */
  278.     telCADNormal                = 1,                            /* normal disconnect */
  279.     telCADBusy                    = 2,                            /* remote user busy */
  280.     telCADNoResponse            = 3,                            /* remote not responding */
  281.     telCADRejected                = 4,                            /* call rejected */
  282.     telCADNumberChanged            = 5,                            /* number changed */
  283.     telCADInvalidDest            = 6,                            /* invalid destination address */
  284.     telCADFacilityRejected        = 7,                            /* requested facility rejected */
  285.     telCADUnobtainableDest        = 9,                            /* destination not obtainable */
  286.     telCADCongested                = 10,                            /* network congestion */
  287.     telCADIncompatibleDest        = 11,                            /* incompatible destination */
  288.     telCADTimeout                = 12,                            /* call timed out */
  289.     telCADUnknown                = 15,                            /* reason unknown */
  290. /* CONFERENCE MESSAGES */
  291.     telConferencePrepFailed        = 0,                            /* conference could not be prepared */
  292.     telConferencePending        = 1,                            /* conference prepared successfully */
  293.     telConferenceEstFailed        = 2,                            /* conference could not be established */
  294.     telConferenceEst            = 3,                            /* conference established */
  295. /* TRANSFER MESSAGES */
  296.     telTransferPrepFailed        = 0,                            /* transfer could not be prepared */
  297.     telTransferPending            = 1,                            /* transfer prepared successfully */
  298.     telTransferEst                = 2,                            /* consult or blind xfer successful */
  299.     telTransferFailed            = 3,                            /* consult or blind xfer failed */
  300.     telTransferred                = 4,                            /* message to originator of CA specifying 
  301.                                      * that call was transferred to rmtDN */
  302. /* HOLD MESSAGES */
  303.     telHoldCleared                = 0,
  304.     telHoldEst                    = 1,
  305.     telHoldFailed                = 2,
  306. /* RECEIVE DIGIT MESSAGES */
  307.     telDigitAudible                = 0,
  308.     telDigitNotAudible            = 1,
  309. /* CALL PARK MESSAGES */
  310.     telCallParkEst                = 1,                            /* call has been successfully parked */
  311.     telCallParkRetrieveEst        = 2,                            /* parked Call has been successfully retrieved */
  312.     telCallParkFailed            = 3,                            /* attempt to setup call park has failed */
  313.     telCallParkRetrieveFailed    = 4,                            /* attempt to retrieve parked call failed */
  314.     telCallParkRecall            = 5,                            /* call park has been recalled */
  315. /* CALL BACK MESSAGES */
  316.     telCallbackCleared            = 0,                            /* call back has been cleared */
  317.     telCallbackEst                = 1,                            /* call back has been established */
  318.     telCallbackNowAvail            = 2,                            /* call can be called back with TELCallBackNow */
  319. /* if CA is zero, else call IS calling back on CA */
  320.     telCallbackFailed            = 3,                            /* attempt to setup callback has failed */
  321.     telCallbackDesired            = 4,                            /* a user has called this terminal, received no 
  322.                                      * answer and desires this terminal to call it 
  323.                                      * back */
  324.     telCallbackDesiredCleared    = 5,                            /* call back for no answer no longer desired */
  325.     telCalledback                = 6,                            /* callback has occurred successfully */
  326. /* CALL REJECT MESSAGES */
  327.     telCallRejectFailed            = 0,                            /* attempt to reject call has failed */
  328.     telCallRejectEst            = 1,                            /* call successfully rejected */
  329.     telCallRejected                = 2,                            /* message to originator that call was rejected */
  330. /* CALL DEFLECT MESSAGES */
  331.     telCallDeflectFailed        = 0,                            /* attempt to deflect call has failed */
  332.     telCallDeflectEst            = 1,                            /* call successfully deflected */
  333.     telCallDeflectRecall        = 2,                            /* deflected call has been recalled */
  334.     telCallDeflected            = 3,                            /* message to originator that call was deflected 
  335.                                      * to rmtDN */
  336.     telAutoDeflectImmediate        = 4,                            /* a call was automatically deflected from this 
  337.                                      * terminal as a result of immediate call 
  338.                                      * forwarding */
  339.     telAutoDeflectBusy            = 5,                            /* a call was automatically deflected from this 
  340.                                      * terminal as a result of call forwarding on busy */
  341.     telAutoDeflectNoAnswer        = 6,                            /* a call was automatically deflected from this 
  342.                                      * terminal as a result of call forwarding on 
  343.                                      * no answer */
  344. /* CONFERENCE SPLIT MESSAGES */
  345.     telConferenceSplitFailed    = 0,                            /* CA could not be split */
  346.     telConferenceSplitEst        = 1,                            /* CA split successfully */
  347. /* CONFERENCE DROP MESSAGES */
  348.     telConferenceDropFailed        = 0,                            /* CA could not be dropped */
  349.     telConferenceDropped        = 1,                            /* CA dropped successfully */
  350. /* CALL PICKUP MESSAGES */
  351.     telCallPickupEst            = 0,                            /* call pickup was successful */
  352.     telCallPickupFailed            = 1,                            /* call pickup failed */
  353.     telCallPickedUp                = 2,                            /* message to originator that call was picked 
  354.                                      * up at a different DN */
  355. /* PAGING MESSAGES */
  356.     telPageEst                    = 0,                            /* paging was successful */
  357.     telPageComplete                = 1,                            /* paging activity completed */
  358.     telPageFailed                = 2,                            /* paging failed */
  359. /* INTERCOM MESSAGES */
  360.     telIntercomEst                = 0,                            /* intercom was successful */
  361.     telIntercomComplete            = 1,                            /* intercom activity completed */
  362.     telIntercomFailed            = 2,                            /* intercom failed */
  363. /* MODEM TONE MESSAGES */
  364.     telModemToneDetected        = 0,                            /* modem tone was detected */
  365.     telModemToneCleared            = 1,                            /* modem tone went away */
  366. /* FAX TONE MESSAGES */
  367.     telFaxToneDetected            = 0,                            /* fax tone was detected */
  368.     telFaxToneCleared            = 1,                            /* fax tone went away */
  369. /* IN USE MESSAGES */
  370.     telInUsePrivate                = 0,                            /* MADN is in use and can't be accessed */
  371.     telInUseCanAccess            = 1,                            /* MADN is in use, and others can access it 
  372.                                      * and join in */
  373.     telInUseCanMakePrivate        = 2,                            /* MADN is in use, but available for any one
  374.                                      * person to access */
  375.     telInUseCleared                = 3,                            /* MADN is no longer in use */
  376. /* CALL APPEARANCE STATES */
  377.     telCAIdleState                = 0,                            /* a call doesn't exist at this time */
  378.     telCAInUseState                = 1,                            /* the call is active but at another terminal */
  379.     telCAOfferState                = 2,                            /* a call is being offered to the terminal */
  380.     telCAQueuedState            = 3,                            /* a call is being queued at this terminal */
  381.     telCAAlertingState            = 4,                            /* a call is alerting at the terminal */
  382.     telCADialToneState            = 5,                            /* initiated outgoing call has dialtone */
  383.     telCADialingState            = 6,                            /* initiated outgoing call is dialing */
  384.     telCAWaitingState            = 7,                            /* initiated outgoing call is waiting for
  385.                                      * response from destination */
  386.     telCARingingState            = 8,                            /* the outgoing call is ringing. */
  387.     telCABusyState                = 9,                            /* destination is busy or can't be reached */
  388.     telCAHeldState                = 10,                            /* call has been put on hold by this terminal */
  389.     telCAConferencedState        = 11,                            /* this CA is part of a conference now */
  390.     telCAActiveState            = 12,                            /* the call is active and parties are free 
  391.                                      * to exchange data */
  392.     telCAReorderState            = 13,                            /* CA is in a reorder state */
  393.     telCAConferencedHeldState    = 14,                            /* CA is a conference call in a held state */
  394.     telCAUnknownState            = 15,                            /* the call state is unknown */
  395. /* TERMINAL MESSAGE EVENTMASKS */
  396.     telTermHookMsg                = 0x00000001,                    /* the hookswitch state has changed */
  397.     telTermKeyMsg                = 0x00000002,                    /* a phone pad key has been depressed */
  398.     telTermVolMsg                = 0x00000004,                    /* volume setting has changed */
  399.     telTermDisplayMsg            = 0x00000008,                    /* display has changed */
  400.     telTermEnableMsg            = 0x00000010,                    /* terminal has become enabled */
  401.     telTermOpenMsg                = 0x00000020,                    /* terminal has been opened */
  402.     telTermCloseMsg                = 0x00000040,                    /* terminal is shutting down */
  403.     telTermResetMsg                = 0x00000080,                    /* terminal has been reset */
  404.     telTermErrorMsg                = 0x00000100,                    /* hard equipment error */
  405.     telTermIndHSStateChgMsg        = 0x00000200,                    /* change in handset state from inacive to */
  406. /* active or vice versa */
  407.     telTermIndHSConnectMsg        = 0x00000400,                    /* independent handset connection has been changed */
  408.     telTermKeyImmMsg            = 0x00000800,                    /* immidiate arrival of phone pad key */
  409.     telTermVolStateMsg            = 0x00001000,                    /* volume state has changed */
  410.     telTermOtherMsg                = (long)0x80000000,                /* vendor defined error */
  411.     telAllTermMsgs                = 0x00001fff,                    /* mask to all non tool specific terminal events */
  412. /* DN MESSAGE EVENTMASK CONSTANTS */
  413.     telDNForwardMsg                = 0x00000001,                    /* forward feature activity */
  414.     telDNDNDMsg                    = 0x00000002,                    /* do not disturb feature activity */
  415.     telDNVoiceMailMsg            = 0x00000004,                    /* message has arrived for this DN */
  416.     telDNSelectedMsg            = 0x00000008,                    /* DN has been selected or deselected */
  417.     telDNOtherMsg                = (long)0x80000000,                /* a custom message for use by tools */
  418.     telAllDNMsgs                = 0x0000000f,                    /* mask to all non tool specific dn events */
  419. /* CA MESSAGE EVENTMASK CONSTANTS */
  420.     telCAAlertingMsg            = 0x00000001,                    /* CA is alerting  */
  421.     telCAOfferMsg                = 0x00000002,                    /* CA is being offered a call */
  422.     telCAProgressMsg            = 0x00000004,                    /* call progress info for this CA */
  423.     telCAOutgoingMsg            = 0x00000008,                    /* CA is initiating an outgoing call */
  424.     telCADisconnectMsg            = 0x00000010,                    /* CA disconnected (dropped or rmt disc */
  425.     telCAActiveMsg                = 0x00000020,                    /* CA is active and voice/data is free 
  426.                                              * to flow end to end */
  427.     telCAConferenceMsg            = 0x00000040,                    /* conference activity on CA */
  428.     telCATransferMsg            = 0x00000080,                    /* transfer feature activity */
  429.     telCAHoldMsg                = 0x00000100,                    /* hold feature activity */
  430.     telCADigitsMsg                = 0x00000200,                    /* remote signaling digits arrived */
  431.     telCACallParkMsg            = 0x00000400,                    /* CA call park feature activity */
  432.     telCACallbackMsg            = 0x00000800,                    /* CA call back feature activity  */
  433.     telCARejectMsg                = 0x00001000,                    /* CA is rejected */
  434.     telCADeflectMsg                = 0x00002000,                    /* CA is deflected */
  435.     telCAForwardMsg                = 0x00004000,                    /* CA is forwarded to this DN  */
  436.     telCAConferenceSplitMsg        = 0x00008000,                    /* conference split activity  */
  437.     telCAConferenceDropMsg        = 0x00010000,                    /* conference drop activity  */
  438.     telCAQueuedMsg                = 0x00020000,                    /* CA has been queued  */
  439.     telCAInUseMsg                = 0x00040000,                    /* CA is in use  */
  440.     telCACallPickupMsg            = 0x00080000,                    /* CA pickup activity */
  441.     telCAPagingMsg                = 0x00100000,                    /* CA paging activity */
  442.     telCAIntercomMsg            = 0x00200000,                    /* CA intercom activity */
  443.     telCAModemToneMsg            = 0x00400000,                    /* modem tones detected */
  444.     telCAFaxToneMsg                = 0x00800000,                    /* fax tones detected */
  445.     telCAIdleMsg                = 0x01000000,                    /* CA is in idle state */
  446.     telCASuccessiveAlertMsg        = 0x02000000,                    /* phone is alerting, one per ring */
  447.     telCAUserUserInfoMsg        = 0x04000000,                    /* user to user information has arrrived 
  448.                                              * for this CA */
  449.     telCAHandOffMsg                = 0x08000000,                    /* CA is ready for hand-off */
  450.     telCAVoiceDetectedMsg        = 0x10000000,                    /* voice Detect related event */
  451.     telCASilenceDetectedMsg        = 0x20000000,                    /* silence Detect related event */
  452.     telCADigitsImmMsg            = 0x40000000,                    /* immidiate arrival of remote signaling digits */
  453.     telCAOtherMsg                = (long)0x80000000,                /* tool specific CA message */
  454.     telAllCAMsgs                = 0x7fffffff                    /* mask to all non tool specific CA events */
  455. };
  456.  
  457. typedef OSErr TELErr;
  458.  
  459. typedef unsigned long TELFlags;
  460.  
  461.  
  462. enum {
  463.     telNoMenus                    = 1L << 16,                        /* tells tool not to display any custom menus */
  464.     telQuiet                    = 1L << 17,                        /* tells tool not to display any dialog boxes or alerts */
  465.     telConfigChanged            = 1L << 18                        /* notifies application that the config has changed */
  466. };
  467.  
  468. typedef unsigned long TELFeatureFlags;
  469.  
  470.  
  471. enum {
  472.     pcmAvail                    = 1L << 0,                        /* true if PCM voice data accessible */
  473.     hasHandset                    = 1L << 1,                        /* true if a phone handset is attached  */
  474.     hasSpeakerphone                = 1L << 2,                        /* true if a 2 way speakerphone is attached */
  475.     canOnHookDial                = 1L << 3,                        /* can on-hook dial */
  476.     hasRinger                    = 1L << 4,                        /* terminal has its own ringer */
  477.     canSetDisplay                = 1L << 5,                        /* application can write to the display */
  478.     hasKeypad                    = 1L << 6,                        /* attached phone has standard 12 key pad */
  479.     hasVideo                    = 1L << 7,                        /* terminal has a videophone */
  480.     hasOther                    = 1L << 8,                        /* reserved for future use */
  481.     crossDNConference            = 1L << 9,                        /* can perform cross-DN conferences */
  482.     hasSubaddress                = 1L << 10,                        /* attached network supports subaddressing */
  483.     hasUserUserInfo                = 1L << 11,                        /* network supports user-to-user info */
  484.     hasHandsetSoundStreams        = 1L << 12,                        /* sound streams are supported on the handset */
  485.     hasIndHandset                = 1L << 13,                        /* handset can be accessed independently of the phone line */
  486.     hasBuiltinSpeakerphone        = 1L << 14                        /* speaker and microphone of the Mac can be used */
  487. };
  488.  
  489. struct TELTermRecord {
  490.     short                            tRef;
  491.     TELFeatureFlags                    featureFlags;
  492.     short                            handsetSpeakerVol;
  493.     short                            handsetMicVol;
  494.     short                            speakerphoneVol;
  495.     short                            speakerphoneMicVol;
  496.     short                            ringerVol;
  497.     short                            otherVol;
  498.     short                            ringerTypes;
  499.     short                            hasDisplay;
  500.     short                            displayRows;
  501.     short                            numDNs;
  502.     short                            maxAllocCA;
  503.     short                            curAllocCA;
  504.     short                            builtinSpeakerVol;
  505.     short                            builtinSpeakerMicVol;
  506.     long                            reserved;
  507. };
  508. typedef struct TELTermRecord TELTermRecord;
  509.  
  510. typedef TELTermRecord *TELTermPtr;
  511.  
  512. struct TELRecord {
  513.     short                            procID;
  514.     TELFlags                        flags;
  515.     short                            reserved;
  516.     long                            refCon;
  517.     long                            userData;
  518.     UniversalProcPtr                defproc;
  519.     Ptr                                config;
  520.     Ptr                                oldConfig;
  521.     TELTermPtr                        pTELTerm;
  522.     long                            telPrivate;
  523.     long                            reserved1;
  524.     long                            reserved2;
  525.     long                            pTELTermSize;
  526.     short                            version;
  527. };
  528. typedef struct TELRecord TELRecord;
  529.  
  530. typedef TELRecord *TELPtr, **TELHandle;
  531.  
  532. typedef unsigned long TELDNFeatureFlags;
  533.  
  534.  
  535. enum {
  536.     dndSub                        = 1L << 0,                        /* do not disturb subscribed */
  537.     dndAvail                    = 1L << 1,                        /* do not disturb available */
  538.     dndActive                    = 1L << 2,                        /* do not disturb active */
  539.     voiceMailAccessSub            = 1L << 3,                        /* message waiting subscribed */
  540.     voiceMailAccessAvail        = 1L << 4,                        /* message waiting available */
  541.     voiceMailAccessActive        = 1L << 5,                        /* message waiting active */
  542.     pagingSub                    = 1L << 6,                        /* paging is subscribed */
  543.     pagingAvail                    = 1L << 7,                        /* paging is available */
  544.     pagingActive                = 1L << 8,                        /* paging is active */
  545.     intercomSub                    = 1L << 9,                        /* intercom is subscribed */
  546.     intercomAvail                = 1L << 10,                        /* intercom is available */
  547.     intercomActive                = 1L << 11,                        /* intercom is active */
  548.     dnSelectSub                    = 1L << 12,                        /* DN select is subscribed */
  549.     dnSelectAvail                = 1L << 13,                        /* DN select is available */
  550.     dnSelectActive                = 1L << 14,                        /* DN is selected */
  551.     callPickupSub                = 1L << 15,                        /* call pickup is subscribed */
  552.     callPickupAvail                = 1L << 16,                        /* call pickup is available */
  553.     dnInUse                        = 1L << 17,                        /* a CA is allocated for this DN */
  554.     logicalDN                    = 1L << 18,                        /* this DN is not on this terminal */
  555.     dnAccessible                = 1L << 19,                        /* commands can be sent to this DN */
  556.     canInitiate                    = 1L << 20,                        /* an outgoing CA can be initiated */
  557.     voiceMessageWaiting            = 1L << 21,                        /* voice mail waiting for this dn */
  558.     hasDNSoundStreams            = 1L << 22,                        /* sound streams are supported on this DN */
  559.     autoAnswerAvail                = 1L << 23,                        /* AutoAnswer is set for this DN */
  560.     autoAnswerActive            = 1L << 24,                        /* AutoAnswer is currently applied to CA on this DN */
  561.     tollSaverAvail                = 1L << 25,                        /* tollSaver is set for this DN */
  562.     tollSaverActive                = 1L << 26                        /* tollSaver is currently applied to CA on this DN */
  563. };
  564.  
  565. typedef unsigned long TELDNForwardFlags;
  566.  
  567.  
  568. enum {
  569.     immediateForwardSub            = 1L << 0,                        /* immediate call forward subscribed */
  570.     immediateForwardAvail        = 1L << 1,                        /* immediate call forward available */
  571.     immediateForwardActive        = 1L << 2,                        /* immediate call forward active */
  572.     busyForwardSub                = 1L << 3,                        /* forward on busy subscribed */
  573.     busyForwardAvail            = 1L << 4,                        /* forward on busy available */
  574.     busyForwardActive            = 1L << 5,                        /* forward on busy active */
  575.     noAnswerForwardSub            = 1L << 6,                        /* no answer call forward subscribed */
  576.     noAnswerForwardAvail        = 1L << 7,                        /* no answer call forward available */
  577.     noAnswerForwardActive        = 1L << 8,                        /* no answer call forward active */
  578.     busyNAForwardSub            = 1L << 9,                        /* busy & no answer call forward subscribed */
  579.     busyNAForwardAvail            = 1L << 10,                        /* busy & no answer call forward available */
  580.     busyNAForwardActive            = 1L << 11                        /* busy & no answer call forward active */
  581. };
  582.  
  583. struct TELDNRecord {
  584.     short                            dnRef;
  585.     StringPtr                        dn;
  586.     StringPtr                        dnPartyName;
  587.     StringPtr                        dnSubaddress;
  588.     TELHandle                        hTEL;
  589.     short                            maxAllocCA;
  590.     short                            curAllocCA;
  591.     short                            dnType;
  592.     TELDNFeatureFlags                featureFlags;
  593.     short                            numPageIDs;
  594.     short                            numIntercomIDs;
  595.     short                            numPickupIDs;
  596.     TELDNForwardFlags                forwardFlags;
  597.     StringPtr                        iForwardDN;
  598.     StringPtr                        iForwardSubaddress;
  599.     StringPtr                        iForwardPartyName;
  600.     StringPtr                        bForwardDN;
  601.     StringPtr                        bForwardSubaddress;
  602.     StringPtr                        bForwardPartyName;
  603.     StringPtr                        naForwardDN;
  604.     StringPtr                        naForwardSubaddress;
  605.     StringPtr                        naForwardPartyName;
  606.     short                            naForwardRings;
  607.     long                            telDNPrivate;
  608.     long                            refCon;
  609.     long                            userData;
  610.     long                            reserved;
  611. };
  612. typedef struct TELDNRecord TELDNRecord;
  613.  
  614. typedef TELDNRecord *TELDNPtr, **TELDNHandle;
  615.  
  616. typedef unsigned long TELCAFeatureFlags;
  617.  
  618.  
  619. enum {
  620.     holdSub                        = 1L << 0,                        /* hold subscribed  */
  621.     holdAvail                    = 1L << 1,                        /* hold available  */
  622.     holdActive                    = 1L << 2,                        /* hold active  */
  623.     conferenceSub                = 1L << 3,                        /* conference subscribed */
  624.     conferenceAvail                = 1L << 4,                        /* conference available */
  625.     conferenceActive            = 1L << 5,                        /* conference active  */
  626.     conferenceDropSub            = 1L << 6,                        /* conference drop subscribed  */
  627.     conferenceDropAvail            = 1L << 7,                        /* a call to TELDrop will drop this 
  628.                                          * CA only from a conference */
  629.     conferenceSplitSub            = 1L << 8,                        /* conference split subscribed  */
  630.     conferenceSplitAvail        = 1L << 9,                        /* conference split available for this CA */
  631.     numToConferenceRequired        = 1L << 10,                        /* the number of CAs to be conferenced is 
  632.                                          * required in TELConfPrep  */
  633.     transferSub                    = 1L << 11,                        /* transfer subscribed  */
  634.     transferAvail                = 1L << 12,                        /* transfer available  */
  635.     transferActive                = 1L << 13,                        /* transfer active */
  636.     caRelated                    = 1L << 14                        /* this CA is the specified in some 
  637.                                          * other CA's relatedCA field  */
  638. };
  639.  
  640. typedef unsigned long TELCAOtherFeatures;
  641.  
  642.  
  643. enum {
  644.     callbackSub                    = 1L << 0,                        /* call back subscribed */
  645.     callbackAvail                = 1L << 1,                        /* call back available */
  646.     callbackActive                = 1L << 2,                        /* call back active  */
  647.     callbackClearSub            = 1L << 3,                        /* call back clearing subscribed */
  648.     callbackNowSub                = 1L << 4,                        /* call back now subscribed */
  649.     callbackNowAvail            = 1L << 5,                        /* call back now available  */
  650.     callbackBusy                = 1L << 6,                        /* call back on busy */
  651.     callbackNoAnswer            = 1L << 7,                        /* call back on no answer */
  652.     callbackReturnsRef            = 1L << 8,                        /* call back returns a reference */
  653.     parkSub                        = 1L << 9,                        /* call park subscribed */
  654.     parkAvail                    = 1L << 10,                        /* call park available */
  655.     parkActive                    = 1L << 11,                        /* call park active */
  656.     parkRetrieveSub                = 1L << 12,                        /* call park retrieve subscribed */
  657.     parkRetrieveWithID            = 1L << 13,                        /* retrieve parked calls with IDs */
  658.     parkWithReturnedID            = 1L << 14,                        /* park call to a specific remote ID */
  659.     parkWithGivenID                = 1L << 18,                        /* for switch that requires ID for parking */
  660.     rejectable                    = 1L << 15,                        /* CA is rejectable  */
  661.     deflectable                    = 1L << 16,                        /* CA is deflectable  */
  662.     acceptable                    = 1L << 17,                        /* CA is acceptable */
  663.     voiceDetected                = 1L << 19,                        /* voice has been detected on this CA incase of 
  664.                                                 an incoming call */
  665.     callAnswdTSRings            = 1L << 20                        /* incoimng call was answered on TollSaver rings */
  666. };
  667.  
  668. typedef struct TELCARecord TELCARecord;
  669.  
  670. typedef TELCARecord *TELCAPtr, **TELCAHandle;
  671.  
  672. struct TELCARecord {
  673.     short                            caRef;
  674.     TELDNHandle                        hTELDN;
  675.     TELHandle                        hTEL;
  676.     short                            caState;
  677.     TELCAHandle                        relatedCA;
  678.     long                            connectTime;                /* can be used by application to keep track of connect time */
  679.     short                            intExt;
  680.     short                            callType;
  681.     short                            dialType;
  682.     short                            bearerType;
  683.     short                            rate;
  684.     StringPtr                        rmtDN;
  685.     StringPtr                        rmtPartyName;
  686.     StringPtr                        rmtSubaddress;
  687.     StringPtr                        routeDN;
  688.     StringPtr                        routePartyName;
  689.     StringPtr                        routeSubaddress;
  690.     short                            priority;
  691.     short                            conferenceLimit;
  692.     TELCAFeatureFlags                featureFlags;
  693.     TELCAOtherFeatures                otherFeatures;
  694.     long                            telCAPrivate;
  695.     long                            refCon;
  696.     long                            userData;
  697.     long                            reserved;
  698. };
  699. /* Constants for HandleType in structure above */
  700.  
  701. enum {
  702.     telHandleType                = 0,                            /* feature requires a terminal handle */
  703.     telDNHandleType                = 1,                            /* feature requires a DN handle */
  704.     telCAHandleType                = 2                                /* feature requires a CA handle */
  705. };
  706.  
  707. struct FeatureList {
  708.     short                            featureID;
  709.     StringPtr                        featureName;
  710.     short                            handleType;
  711.     struct FeatureList                *nextFeature;
  712. };
  713. typedef struct FeatureList FeatureList;
  714.  
  715. typedef FeatureList *FeatureListPtr;
  716.  
  717. /* CA MESSAGE STRUCTURES FOR MSGINFO */
  718. struct CAGenericMsgRec {
  719.     StringPtr                        rmtDN;
  720.     StringPtr                        rmtName;
  721.     StringPtr                        rmtSubaddress;
  722.     short                            dialType;
  723. };
  724. typedef struct CAGenericMsgRec CAGenericMsgRec;
  725.  
  726. struct CAUserUserInfoMsgRec {
  727.     StringPtr                        userUserInfo;
  728. };
  729. typedef struct CAUserUserInfoMsgRec CAUserUserInfoMsgRec;
  730.  
  731. struct CAConfMsgRec {
  732.     TELCAHandle                        relatedCA;
  733. };
  734. typedef struct CAConfMsgRec CAConfMsgRec;
  735.  
  736. struct CATransfMsgRec {
  737.     StringPtr                        rmtDN;
  738.     StringPtr                        rmtName;
  739.     StringPtr                        rmtSubaddress;
  740.     short                            dialType;
  741.     TELCAHandle                        prepCA;
  742. };
  743. typedef struct CATransfMsgRec CATransfMsgRec;
  744.  
  745. typedef pascal void (*TelephoneTermMsgProcPtr)(TELHandle hTEL, long msg, short mtype, short value, long globals);
  746. typedef pascal void (*TelephoneDNMsgProcPtr)(TELDNHandle hTELDN, long Msg, short mtype, short value, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress, long globals);
  747. typedef pascal void (*TelephoneCAMsgProcPtr)(TELCAHandle hTELCA, long Msg, short mtype, short value, Ptr Msginfo, long globals);
  748. typedef pascal void (*TelephoneChooseIdleProcPtr)(void);
  749.  
  750. #if GENERATINGCFM
  751. typedef UniversalProcPtr TelephoneTermMsgUPP;
  752. typedef UniversalProcPtr TelephoneDNMsgUPP;
  753. typedef UniversalProcPtr TelephoneCAMsgUPP;
  754. typedef UniversalProcPtr TelephoneChooseIdleUPP;
  755. #else
  756. typedef TelephoneTermMsgProcPtr TelephoneTermMsgUPP;
  757. typedef TelephoneDNMsgProcPtr TelephoneDNMsgUPP;
  758. typedef TelephoneCAMsgProcPtr TelephoneCAMsgUPP;
  759. typedef TelephoneChooseIdleProcPtr TelephoneChooseIdleUPP;
  760. #endif
  761.  
  762. enum {
  763.     uppTelephoneTermMsgProcInfo = kPascalStackBased
  764.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELHandle)))
  765.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  766.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  767.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  768.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  769.     uppTelephoneDNMsgProcInfo = kPascalStackBased
  770.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELDNHandle)))
  771.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  772.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  773.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  774.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(ConstStr255Param)))
  775.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(ConstStr255Param)))
  776.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(ConstStr255Param)))
  777.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long))),
  778.     uppTelephoneCAMsgProcInfo = kPascalStackBased
  779.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELCAHandle)))
  780.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  781.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  782.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  783.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Ptr)))
  784.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long))),
  785.     uppTelephoneChooseIdleProcInfo = kPascalStackBased
  786. };
  787.  
  788. #if GENERATINGCFM
  789. #define NewTelephoneTermMsgProc(userRoutine)        \
  790.         (TelephoneTermMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, GetCurrentArchitecture())
  791. #define NewTelephoneDNMsgProc(userRoutine)        \
  792.         (TelephoneDNMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, GetCurrentArchitecture())
  793. #define NewTelephoneCAMsgProc(userRoutine)        \
  794.         (TelephoneCAMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, GetCurrentArchitecture())
  795. #define NewTelephoneChooseIdleProc(userRoutine)        \
  796.         (TelephoneChooseIdleUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo, GetCurrentArchitecture())
  797. #else
  798. #define NewTelephoneTermMsgProc(userRoutine)        \
  799.         ((TelephoneTermMsgUPP) (userRoutine))
  800. #define NewTelephoneDNMsgProc(userRoutine)        \
  801.         ((TelephoneDNMsgUPP) (userRoutine))
  802. #define NewTelephoneCAMsgProc(userRoutine)        \
  803.         ((TelephoneCAMsgUPP) (userRoutine))
  804. #define NewTelephoneChooseIdleProc(userRoutine)        \
  805.         ((TelephoneChooseIdleUPP) (userRoutine))
  806. #endif
  807.  
  808. #if GENERATINGCFM
  809. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  810.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, (hTEL), (msg), (mtype), (value), (globals))
  811. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  812.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, (hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  813. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  814.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, (hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  815. #define CallTelephoneChooseIdleProc(userRoutine)        \
  816.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo)
  817. #else
  818. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  819.         (*(userRoutine))((hTEL), (msg), (mtype), (value), (globals))
  820. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  821.         (*(userRoutine))((hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  822. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  823.         (*(userRoutine))((hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  824. #define CallTelephoneChooseIdleProc(userRoutine)        \
  825.         (*(userRoutine))()
  826. #endif
  827.  
  828. extern pascal TELErr InitTEL(void);
  829. extern pascal TELErr TELGetInfo(TELHandle hTEL);
  830. extern pascal TELErr TELOpenTerm(TELHandle hTEL);
  831. extern pascal TELErr TELResetTerm(TELHandle hTEL);
  832. extern pascal TELErr TELCloseTerm(TELHandle hTEL);
  833. extern pascal TELErr TELTermMsgHand(TELHandle hTEL, long eventMask, TelephoneTermMsgUPP msgProc, long globals);
  834. extern pascal TELErr TELClrTermMsgHand(TELHandle hTEL, TelephoneTermMsgUPP msgProc);
  835. extern pascal TELErr TELTermEventsSupp(TELHandle hTEL, long *eventMask);
  836. extern pascal short TELGetProcID(Str255 name);
  837. extern pascal TELHandle TELNew(short procID, TELFlags flags, long refCon, long userData);
  838. extern pascal TELHandle TELNewWithResult(short procID, TELFlags flags, long refCon, long userData, TELErr *error);
  839. extern pascal TELErr TELDefault(Ptr *theConfig, short procID, Boolean allocate);
  840. extern pascal Boolean TELValidate(TELHandle hTEL);
  841. extern pascal Ptr TELGetConfig(TELHandle hTEL);
  842. extern pascal short TELSetConfig(TELHandle hTEL, Ptr thePtr);
  843. extern pascal TELErr TELChoose(TELHandle *hTEL, Point where, TelephoneChooseIdleUPP idleProc);
  844. extern pascal Handle TELSetupPreflight(short procID, long *magicCookie);
  845. extern pascal void TELSetupSetup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  846. extern pascal Boolean TELSetupFilter(short procID, Ptr theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie);
  847. extern pascal void TELSetupItem(short procID, Ptr theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie);
  848. extern pascal void TELSetupCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  849. extern pascal void TELSetupXCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie);
  850. extern pascal void TELSetupPostflight(short procID);
  851. extern pascal TELErr TELDispose(TELHandle hTEL);
  852. extern pascal short TELCountDNs(TELHandle hTEL, short dnType, Boolean physical);
  853. extern pascal TELErr TELDNLookupByIndex(TELHandle hTEL, short dnType, Boolean physical, short index, TELDNHandle *hTELDN);
  854. extern pascal TELErr TELDNLookupByName(TELHandle hTEL, ConstStr255Param DN, TELDNHandle *hTELDN);
  855. extern pascal TELErr TELDNSelect(TELDNHandle hTELDN, Boolean select);
  856. extern pascal TELErr TELDNDispose(TELDNHandle hTELDN);
  857. extern pascal TELErr TELGetDNInfo(TELDNHandle hTELDN);
  858. extern pascal TELErr TELGetDNFlags(TELDNHandle hTELDN, long *dnFeatureFlags, long *dnForwardFlags);
  859. extern pascal TELErr TELDNMsgHand(TELDNHandle hTELDN, Boolean allDNs, long eventMask, TelephoneDNMsgUPP msgProc, long globals);
  860. extern pascal TELErr TELClrDNMsgHand(TELDNHandle hTELDN, TelephoneDNMsgUPP msgProc);
  861. extern pascal TELErr TELDNEventsSupp(TELDNHandle hTELDN, long *eventMask);
  862. extern pascal short TELCountCAs(TELDNHandle hTELDN, short internalExternal);
  863. extern pascal TELErr TELCALookup(TELDNHandle hTELDN, short internalExternal, short index, TELCAHandle *hTELCA);
  864. extern pascal TELErr TELCADispose(TELCAHandle hTELCA);
  865. extern pascal TELErr TELGetCAState(TELCAHandle hTELCA, short *state);
  866. extern pascal TELErr TELGetCAFlags(TELCAHandle hTELCA, long *caFeatureFlags, long *caOtherFeatures);
  867. extern pascal TELErr TELGetCAInfo(TELCAHandle hTELCA);
  868. extern pascal TELErr TELCAMsgHand(TELDNHandle hTELDN, long eventMask, TelephoneCAMsgUPP msgProc, long globals);
  869. extern pascal TELErr TELClrCAMsgHand(TELDNHandle hTELDN, TelephoneCAMsgUPP msgProc);
  870. extern pascal TELErr TELCAEventsSupp(TELDNHandle hTELDN, long *eventMask);
  871. extern pascal TELErr TELSetupCall(TELDNHandle hTELDN, TELCAHandle *hTELCA, ConstStr255Param destDN, ConstStr255Param destName, ConstStr255Param destSubaddress, ConstStr255Param userUserInfo, short bearerType, short rate);
  872. extern pascal TELErr TELConnect(TELCAHandle hTELCA);
  873. extern pascal TELErr TELDialDigits(TELCAHandle hTELCA, ConstStr255Param digits);
  874. extern pascal TELErr TELAcceptCall(TELCAHandle hTELCA);
  875. extern pascal TELErr TELRejectCall(TELCAHandle hTELCA, short reason);
  876. extern pascal TELErr TELDeflectCall(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  877. extern pascal TELErr TELAnswerCall(TELCAHandle hTELCA);
  878. extern pascal TELErr TELDrop(TELCAHandle hTELCA, ConstStr255Param userUserInfo);
  879. extern pascal TELErr TELHold(TELCAHandle hTELCA);
  880. extern pascal TELErr TELRetrieve(TELCAHandle hTELCA);
  881. extern pascal TELErr TELConferencePrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2, short numToConference);
  882. extern pascal TELErr TELConferenceEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  883. extern pascal TELErr TELConferenceSplit(TELCAHandle hTELCA);
  884. extern pascal TELErr TELTransferPrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  885. extern pascal TELErr TELTransferEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  886. extern pascal TELErr TELTransferBlind(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  887. extern pascal TELErr TELForwardSet(TELDNHandle hTELDN, ConstStr255Param forwardDN, ConstStr255Param forwardName, ConstStr255Param forwardSubaddress, short forwardType, short numrings);
  888. extern pascal TELErr TELForwardClear(TELDNHandle hTELDN, short forwardType);
  889. extern pascal TELErr TELCallbackSet(TELCAHandle hTELCA, short *callbackRef);
  890. extern pascal TELErr TELCallbackClear(TELHandle hTEL, short callbackRef);
  891. extern pascal TELErr TELCallbackNow(TELCAHandle hTELCA, short callbackRef);
  892. extern pascal TELErr TELDNDSet(TELDNHandle hTELDN, short dndType);
  893. extern pascal TELErr TELDNDClear(TELDNHandle hTELDN, short dndType);
  894. extern pascal TELErr TELCallPickup(TELCAHandle hTELCA, ConstStr255Param pickupDN, short pickupGroupID);
  895. extern pascal TELErr TELParkCall(TELCAHandle hTELCA, StringPtr *parkRetrieveID, ConstStr255Param parkID);
  896. extern pascal TELErr TELRetrieveParkedCall(TELCAHandle hTELCA, ConstStr255Param parkRetrieveID);
  897. extern pascal TELErr TELVoiceMailAccess(TELCAHandle hTELCA);
  898. extern pascal TELErr TELPaging(TELCAHandle hTELCA, short pageID);
  899. extern pascal TELErr TELIntercom(TELCAHandle hTELCA, short intercomID);
  900. extern pascal TELErr TELOtherFeatureList(TELHandle hTEL, FeatureListPtr *fList);
  901. extern pascal TELErr TELOtherFeatureImplement(TELHandle hTEL, Handle theHandle, short featureID);
  902. extern pascal TELErr TELToolFunctions(TELHandle hTEL, short msgcode, Boolean *supportsIt);
  903. extern pascal TELErr TELOtherFunction(TELHandle hTEL, Ptr paramblock, long size);
  904. extern pascal TELErr TELGetHooksw(TELHandle hTEL, short hookType, Boolean *offHook);
  905. extern pascal TELErr TELSetHooksw(TELHandle hTEL, short hookType, Boolean offHook);
  906. extern pascal TELErr TELGetVolume(TELHandle hTEL, short volType, short *level, short *volState);
  907. extern pascal TELErr TELSetVolume(TELHandle hTEL, short volType, short *level, short volState);
  908. extern pascal TELErr TELAlert(TELHandle hTEL, short *level, short alertPattern);
  909. extern pascal TELErr TELGetDisplay(TELHandle hTEL, short index, short *displayMode, StringPtr *text);
  910. extern pascal TELErr TELSetDisplay(TELHandle hTEL, short index, short displayMode, ConstStr255Param text);
  911. extern pascal void TELIdle(TELHandle hTEL);
  912. extern pascal void TELActivate(TELHandle hTEL, Boolean activate);
  913. extern pascal void TELResume(TELHandle hTEL, Boolean resume);
  914. extern pascal Boolean TELMenu(TELHandle hTEL, short menuID, short item);
  915. extern pascal void TELEvent(TELHandle hTEL, const EventRecord *theEvent);
  916. extern pascal void TELGetToolName(short procID, Str255 name);
  917. extern pascal Handle TELGetVersion(TELHandle hTEL);
  918. extern pascal short TELGetTELVersion(void);
  919. extern pascal TELErr TELIntlToEnglish(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  920. extern pascal TELErr TELEnglishToIntl(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  921. extern pascal TELErr TELGetDNSoundInput(TELDNHandle hTELDN, Str255 deviceName);
  922. extern pascal TELErr TELDisposeDNSoundInput(TELDNHandle hTELDN, ConstStr255Param deviceName);
  923. extern pascal TELErr TELGetDNSoundOutput(TELDNHandle hTELDN, Component *SndOut);
  924. extern pascal TELErr TELDisposeDNSoundOutput(TELDNHandle hTELDN, Component SndOut);
  925. extern pascal TELErr TELGetHSSoundInput(TELHandle termHand, Str255 deviceName);
  926. extern pascal TELErr TELDisposeHSSoundInput(TELHandle termHand, ConstStr255Param deviceName);
  927. extern pascal TELErr TELGetHSSoundOutput(TELHandle termHand, Component *SndOut);
  928. extern pascal TELErr TELDisposeHSSoundOutput(TELHandle termHand, Component SndOut);
  929. extern pascal TELErr TELDNSetAutoAnswer(TELDNHandle hTELDN, Boolean AutoAnswerOn);
  930. extern pascal TELErr TELDNTollSaverControl(TELDNHandle hTELDN, Boolean QuickAnswer);
  931. extern pascal TELErr TELSetIndHSConnect(TELHandle termHand, Boolean Connect);
  932. extern pascal TELErr TELGetIndHSConnect(TELHandle termHand, Boolean *Connect);
  933. extern pascal TELErr TELCAVoiceDetect(TELCAHandle hTELCA, Boolean VoiceDetectOn);
  934. extern pascal TELErr TELCASilenceDetect(TELCAHandle hTELCA, Boolean DetectOn, long Period);
  935. extern pascal TELErr TELGetTelNewErr(void);
  936. extern pascal TELErr TELDNSetDTMF(TELDNHandle hTELDN, Boolean dtmfOn);
  937. extern pascal TELErr TELDNGetDTMF(TELDNHandle hTELDN, Boolean *dtmfOn);
  938. extern pascal TELErr TELHSSetDTMF(TELHandle termHand, Boolean dtmfOn);
  939. extern pascal TELErr TELHSGetDTMF(TELHandle termHand, Boolean *dtmfOn);
  940. extern pascal TELErr TELGetDNStatus(TELDNHandle hTELDN, long *inUse);
  941. extern pascal TELErr TELGetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean *prgDetOn);
  942. extern pascal TELErr TELSetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean prgDetOn);
  943.  
  944. #ifdef __CFM68K__
  945. #pragma import off
  946. #endif
  947.  
  948. #if GENERATINGPOWERPC
  949. #pragma options align=reset
  950. #endif
  951.  
  952. #ifdef __cplusplus
  953. }
  954. #endif
  955.  
  956. #endif /* __TELEPHONES__ */
  957.